{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import json\n",
    "import pickle\n",
    "import matplotlib\n",
    "import matplotlib.pyplot as plt\n",
    "from IPython.display import display, HTML\n",
    "import os,sys,inspect, pickle\n",
    "import numpy as np\n",
    "\n",
    "pd.set_option('display.max_colwidth', 500)\n",
    "\n",
    "X_AXIS_TITLE = 'Index Storage Consumption'\n",
    "LABEL_FONT_SIZE = 9\n",
    "TITLE_FONT_SIZE = 13\n",
    "MARKER_SIZE = 6\n",
    "LINE_WIDTH = 2\n",
    "GRAPH_SIZE = (3.45,1.73)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "class Style():\n",
    "    def __init__(self, label, color, marker, hatch):\n",
    "        self.label = label\n",
    "        self.color = color\n",
    "        self.marker = marker\n",
    "        self.hatch = hatch\n",
    "        self.index_history = None\n",
    "styles = {\n",
    "    'b': Style('Algorithm 2', '#6599FF', 'd', '/'),\n",
    "    'a': Style('Algorithm 1', '#ff8400', 'o', '.'),\n",
    "}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "fig, ax = plt.subplots()\n",
    "\n",
    "style = styles['a']\n",
    "memory_consumption = [0, 2, 4, 6, 8, 10]\n",
    "relative_costs = [80, 65, 52, 44, 38, 30]\n",
    "ax.step(memory_consumption, relative_costs, where='post', color=style.color, linewidth=LINE_WIDTH)\n",
    "ax.plot(memory_consumption, relative_costs, f'{style.marker}', color=style.color, label=style.label, markersize=MARKER_SIZE)\n",
    "\n",
    "style = styles['b']\n",
    "memory_consumption = [0.2, 3.4, 4.2, 6.5, 8.4, 11]\n",
    "relative_costs = [85, 72, 55, 33, 28, 30]\n",
    "ax.step(memory_consumption, relative_costs, where='post', color=style.color, linewidth=LINE_WIDTH)\n",
    "ax.plot(memory_consumption, relative_costs, f'{style.marker}', color=style.color, label=style.label, markersize=MARKER_SIZE)\n",
    "\n",
    "fig.legend(loc=1,bbox_to_anchor=(0.83, 0.77, 0.075, 0.05), fontsize=LABEL_FONT_SIZE - 1)\n",
    "plt.xlabel(X_AXIS_TITLE, fontsize=LABEL_FONT_SIZE)\n",
    "plt.ylabel('Workload Cost', fontsize=LABEL_FONT_SIZE)\n",
    "\n",
    "plt.tick_params(axis='both',which='both',bottom=False,top=False,labelbottom=False)\n",
    "plt.tick_params(axis='both', which='both', bottom=True,top=False,labelbottom=False, right=False, left=True, labelleft=False)\n",
    "plt.grid()\n",
    "ax.set_axisbelow(True)\n",
    "fig.set_size_inches(GRAPH_SIZE)\n",
    "fig.tight_layout()\n",
    "ax.set_xlim([-0.5, 9.75])\n",
    "fig.savefig(f\"../intro_graph.pdf\", bbox_inches='tight', pad_inches = 0)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
